package sis.testio.inputoutput;/*
 * @auther 顶风少年
 * @mail dfsn19970313@foxmail.com
 * @date 2019-07-29 09:47
 * @notify
 * @version 1.0
 */

import jdk.internal.util.xml.impl.Input;
import junit.framework.TestCase;
import sis.studentinfo.Scorer;

import java.io.*;

public class ByteTest extends TestCase {

    public void testStringReader() {
        //读取 字符串 ABC 写入 到 另外一个字符串
        try {
            String s1 = "ABC";
            String s2 = "";
            Reader reader = new StringReader(s1);
            Writer writer = new StringWriter();
            int c = -1;
            char r[] = new char[1];
            while ((c = reader.read(r)) != -1) {
                writer.write(r);
            }
            System.out.println(writer.toString());
        } catch (Exception e) {
        }
    }

}
